<?php
declare (strict_types = 1);

namespace app\api\controller;
use app\model\QuotesModel;
use think\App;

class Quotes extends Base {

    private $model;

    private $req;

    private $page;

    private $limit = 20;


    public function __construct(App $app)
    {
        parent::__construct($app);

        $this->req = request()->param();

        $this->page = isset($this->req['page']) ? $this->req['page']  : 1;

        $this->version = isset($this->req['version']) ? $this->req['version']  : 1;

        $this->model = new QuotesModel();
    }



    public function getTodayQuotes()
    {
        $converter = new \SolarToLunar();
        $year = date("Y");
        $month = date("m");
        $day = date("d");
        $solarToLunar = $converter->convert($year, $month, $day);
        $data["content"] = $this->model->getDayOne(date("Y-m-d"));
        $data["Ydate"] =  $year."年".$month."月".$day."日";
        $data["Ndate"] = "农历".$solarToLunar["lunarMonthName"].$solarToLunar["lunarDayName"];
        return $this->succ($data);
    }


}
